import datetime

a = datetime.datetime.now()

now_year = a.year      # 年
now_month = a.month    # 月
now_day = a.day        # 日
now_hour = a.hour      # 时
now_min = a.minute     # 分
now_sec = a.second     # 秒

print(now_year)
print(now_month)
print(now_day)
print(now_hour)
print(now_min)
print(now_sec)



all_time_info_obj = a.utctimetuple()
print(all_time_info_obj)
print(all_time_info_obj.tm_hour)   # 时
print(all_time_info_obj.tm_min)    # 分
print(all_time_info_obj.tm_sec)    # 秒

